# -*- coding: utf-8 -*-
# @Time    : 2020/3/20 16:49
# @Author  : LY


class SendSMS(object):
    def __init__(self,driver对象):
        self.driver对象 = driver对象

    # 短信接收者
    def revicever(self,people):
        self.driver对象.find_element_by_id('com.android.messaging:id/start_new_conversation_button').click()
        接收框 = self.driver对象.find_element_by_xpath('//*[contains(@text,"收件人")]')
        接收框.clear()
        接收框.send_keys(f'{people}')
        self.driver对象.keyevent(66)

    # 发送短信内容
    def sms_data(self,sms_datas):
        信息框 = self.driver对象.find_element_by_xpath('//*[contains(@text,"发送信息")]')
        信息框.send_keys(f'{sms_datas}')
    # 短信发送出去
    def sendding_sms(self):
        self.driver对象.find_element_by_id('com.android.messaging:id/send_message_button').click()
